<%@page import="com.icss.th.db.pojo.PageInfo"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.icss.th.fulltext.pojo.SearchResult"%>
<%@ page import="com.icss.th.common.util.SecureUtil"%>
<%
	String spendTime = (String)request.getAttribute("spendTime");
	PageInfo pageInfo = (PageInfo)request.getAttribute("pageInfo");
	List<SearchResult> results = (List<SearchResult>)request.getAttribute("list");
	String id = (String)request.getAttribute("id");
	String name = (String)request.getAttribute("name");
	String context = request.getContextPath();
%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>题海——考试、复习的最佳助手</title>
<meta name="Robots" content="All">
<meta name="description" content="题海题库题目搜索引擎,汇集了近年优秀质量的题库;是一个全国各种学历考试,资格认证考试的全真在线模拟考试网站,是各类考生考前辅导学习的练兵必备工具"/>
<meta name="keywords" content="题海,题海网,学霸,题库,考试答案,题海考试试题,题海试题库,历年真题,模拟试题,预测题,公务员,报关员,建造师,造价师,会计证,会计从业,会计师,经济师,证券资格考试,英语四六级考试,职称英语,公共英语,考研,自考,计算机等级"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="<%=context%>/includes/js/jquery.cookie.js"></script>
<script src="<%=context%>/includes/js/PagerView.js" type="text/javascript"></script>
<link href="<%=context%>/includes/css/PagerView.css" rel="stylesheet" type="text/css">
<link href="<%=context%>/includes/css/base.css" rel="stylesheet" />
<base target="_blank">
<style>
#list {
	line-height: 23px;
	margin: 0;
}
#list ul {
	margin-bottom: 20px;
	margin-left: -40px;
}
#list ul li {
	color: #666;
	list-style: none;
}
i {
	color: red;
}
.t {
	color: #03C;
	text-decoration: underline;
	font-size: 16px;
	line-height: 28px;
}
.t2 {
	color: #090;
}
</style>
</head>
<body>
<input type="hidden" name="pnum" id="pnum" value="">
<input type="hidden" name="id" id="id" value="<%=id%>">
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  <div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">TIHAI</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
    <a class="navbar-brand tihai-logo" href="/">&nbsp;</a> </div>
  <div class="collapse navbar-collapse navbar-ex1-collapse ">
    <p class="navbar-text" style="color:white;margin-left:25px;font-weight:bolder"><%=name%></p>
  </div>
</nav>
<div class="container-fluid">
  <div class="row" id="m_list">
    <div class="col-sm-1"></div>
    <div class="col-sm-8">
      <button onclick="AddFavorite()"  class="btn btn-success btn-xs" type="button"><span class="glyphicon glyphicon-star"></span> &nbsp; 收藏</button>
      <small class="text-danger">本试卷找到约<%=pageInfo.getRecordCount()%>条(<%=spendTime%>s)</small> </div>
  </div>
  <div class="row">
    <div class="col-sm-1"><!--左侧空白--></div>
    <div class="col-sm-6">
      <div id="list">
        <%
	        if (results != null && !results.isEmpty()){
	        	for (SearchResult r : results){
	        %>
        <ul>
          <li><a class="t" href="<%=context%>/question?id=<%=SecureUtil.encryptPassword(r.getId())%>"><%=r.getTitle()%></a></li>
          <li><a class="t2" href="<%=context%>/question?id=<%=SecureUtil.encryptPassword(r.getId())%>"><%=r.getSourceName()%></a></li>
          <li><%=r.getContent()%></li>
        </ul>
        <%
	        	}
	        	        }
	        %>
        <div id="pager" style="height:30px;margin-left:40px;margin-bottom:20px; text-align:left;"> </div>
      </div>
      <div id="pager" style="height:30px; margin-bottom:20px; text-align:left;"></div>
    </div>
    <div class="col-sm-4"><!----></div>
  </div>
  <!--内容结束--><br>
  <br>
  <div class="text-left col-sm-11 col-sm-offset-1">
    <p><a onclick="AddFavorite()" href="#">收藏</a> | <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=1003753463&site=qq&menu=yes">联系我们</a> | <a href="aboutus.html" target="_blank">关于我们</a> | <a href="joinus.html" target="_blank">我要参与</a></p>
    <p> &copy;2013&nbsp;Tihai.org&nbsp;题海科技</p>
  </div>
</div>
<script>

$(document).ready(function() {
	var pager = new PagerView('pager');
	pager.itemCount = <%=pageInfo.getRecordCount()%>;
	pager.size = <%=pageInfo.getCountPerPage()%>;
	pager.index = <%=pageInfo.getPageNum()%>
	pager.render();
	pager.onclick = function(index){
		$('#pnum').val(index);
		_submit();
	};
});


function _submit(){
	var path = '<%=context%>/paper?';
	path += 'id=' + $("#id").val();
	path += '&pnum=' + $("#pnum").val();
	location.href = path;
}

function AddFavorite(){
	var sURL = window.location;
	var sTitle = document.title;
    try{
        window.external.addFavorite(sURL, sTitle);
    }catch (e){
        try{
            window.sidebar.addPanel(sTitle, sURL, "");
        }catch (e){
            alert("加入收藏失败，请使用浏览器收藏功能");
        }
    }
 }
</script> 
<!--统计--> 
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-665718-7', 'tihai.org');
  ga('send', 'pageview');

</script>
</body>
</html>
